function myInstanceof(obj, fn) {
    let fn_prototype = fn.prototype
    let obj_proto = obj.__proto__
    while (obj_proto) {
        if (obj_proto === fn_prototype) {
            return true
        }
        obj_proto = obj_proto.__proto__
    }
    return false
}
function Fn() { }
let a = new Fn()
console.log(a instanceof Fn);   // true
console.log(myInstanceof(a,Fn)); // true